<?php


namespace app\miniProgram\controller;


use app\miniProgram\model\MaterialKucunView;
use think\facade\Db;

class InventoryBalance extends Auth
{
    public function index()
    {
        $bar_code=$this->param['bar_code']??'';
        $mdId=$this->param['mdId']??'';
        $wId=$this->param['wId']??"";
        if (!$wId){
            return $this->jump(0,'请选择仓库');
        }
        if (!$bar_code&&!$mdId){
            return $this->jump(0,'参数不能为空');
        }
//        $where[]=['mdId','>',0];
        $where[]=['wId','=',$wId];
        if ($bar_code){
            $where[]=['bar_code','=',$bar_code];
        }
        if ($mdId){
            $where[]=['mdId','=',$mdId];
        }
        $info=MaterialKucunView::actionInfo($where);
        if (empty($info)){
           return $this->jump(-2,'未入库物料请使用盘盈入库',$info);
        }
        return $this->jump(1,'获取成功',$info);

}
}